package com.imooc.log.my

import org.apache.spark.sql.SparkSession

object ParquestTest {
  def main(args: Array[String]): Unit = {
    val spark = SparkSession.builder().appName("SparkSessionApp").master("local[2]").getOrCreate()


    /**
      * spark.read.format("parquet").load 这是标准写法
      */
    val userDF = spark.read.format("parquet").load("D:\\data\\part-00000-b86927c4-11de-49c0-995d-6e94ff383214.snappy.parquet")
    val userDF1 = spark.read.format("parquet").load("hdfs://hadoop001:8020/demo/clean3/day=20170511/*")

    //打印结构
    userDF.printSchema()
    userDF.show()
  }
}
